Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bring 0.74 support #2047

Merged
merged 10 commits into from
Mar 11, 2024
Merged

feat: bring 0.74 support #2047

merged 10 commits into from
Mar 11, 2024

Conversation

WoLewicki
Copy link
Member

@@ -416,7 +416,7 @@ - (void)notifyHeaderHeightChange:(double)headerHeight
[[RNSHeaderHeightChangeEvent alloc] initWithEventName:@"onHeaderHeightChange"
reactTag:[NSNumber numberWithInt:self.tag]
headerHeight:headerHeight];
[[RCTBridge currentBridge].eventDispatcher sendEvent:event];
[[RCTBridge currentBridge].eventDispatcher notifyObserversOfEvent:event];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RSNara do you maybe know if it is enough for listeners from Animated to be informed that the values changed since for some reason calling sendEvent here on RN 0.74-rc.0 crashed with:

 (NOBRIDGE) ERROR  Error: Failed to call into JavaScript module method RCTEventEmitter.receiveEvent(). Module has not been registered as callable. Registered callable JavaScript modules (n = 8): HMRClient, GlobalPerformanceLogger, RCTNativeAppEventEmitter, SamplingProfiler, RCTDeviceEventEmitter, RCTLog, HeapCapture, Systrace. Did you forget to call `RN$registerCallableModule`?

If I use ScrollView in the example, than it starts to work, so maybe ScrollView registers the module somehow? I can see that registering is done here: https://github.com/facebook/react-native/blob/767330f21885e668bc0d9b5b3063113d0446bcbc/packages/react-native/Libraries/EventEmitter/RCTEventEmitter.js but I cannot see anything connected with ScrollView calling this code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I fixed it in another library: react-native-pager-view
That's a terrible approach, we have to fix though.

ScrollView works because it does this. Which basically import the whole paper renderer to register the RCTEventEmitter.

We will work on a better solution for 0.75, as the fix is more convoluted than just registering the module, unfortunately, and it is unlikely that we would be able to have the proper fix in time for 0.74 stable.

As a work around, you can apply the same fix of above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked and the code I trigger here makes it work with Animated so it is all I need I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WoLewicki Sadly, I don't know if it's all you need. I see that this PR has been raised some time ago, that may be related to your error: #2027
Can you try if applying the fix from pager-view fixes that issue as well?
I might also take a look on that fix, if you don't have any time to spare!

@WoLewicki WoLewicki changed the title feat: FabricTestExample not working with safe area context feat: bring 0.74 support Feb 23, 2024
@tboba
Copy link
Member

tboba commented Mar 7, 2024

Hi @WoLewicki, I see that some tasks on CI are failing here. Do you know what may be the cause of errors?

Copy link
Member

@tboba tboba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got some questions, regarding this PR, but most of the changes are good. Great job! 🎉

@@ -2,8 +2,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to remove that permission?

FabricExample/android/gradle-wrapper.properties Outdated Show resolved Hide resolved
FabricExample/ios/FabricExample/Info.plist Outdated Show resolved Hide resolved
FabricExample/package.json Outdated Show resolved Hide resolved
FabricTestExample/android/gradle-wrapper.properties Outdated Show resolved Hide resolved
FabricTestExample/ios/FabricTestExample/Info.plist Outdated Show resolved Hide resolved
FabricTestExample/package.json Outdated Show resolved Hide resolved
@@ -416,7 +416,7 @@ - (void)notifyHeaderHeightChange:(double)headerHeight
[[RNSHeaderHeightChangeEvent alloc] initWithEventName:@"onHeaderHeightChange"
reactTag:[NSNumber numberWithInt:self.tag]
headerHeight:headerHeight];
[[RCTBridge currentBridge].eventDispatcher sendEvent:event];
[[RCTBridge currentBridge].eventDispatcher notifyObserversOfEvent:event];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WoLewicki Sadly, I don't know if it's all you need. I see that this PR has been raised some time ago, that may be related to your error: #2027
Can you try if applying the fix from pager-view fixes that issue as well?
I might also take a look on that fix, if you don't have any time to spare!

ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this pull request Oct 9, 2024
PR with fixes for new arch in RN 0.74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants